package com.ktgj.flight.service.impl;

import java.util.List;
import com.ktgj.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ktgj.flight.mapper.FlightOutticketLogMapper;
import com.ktgj.flight.domain.FlightOutticketLog;
import com.ktgj.flight.service.IFlightOutticketLogService;

/**
 * 机票订单出票日志Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-02-15
 */
@Service
public class FlightOutticketLogServiceImpl implements IFlightOutticketLogService 
{
    @Autowired
    private FlightOutticketLogMapper flightOutticketLogMapper;

    /**
     * 查询机票订单出票日志
     * 
     * @param logid 机票订单出票日志ID
     * @return 机票订单出票日志
     */
    @Override
    public FlightOutticketLog selectFlightOutticketLogById(Long logid)
    {
        return flightOutticketLogMapper.selectFlightOutticketLogById(logid);
    }

    /**
     * 查询机票订单出票日志列表
     * 
     * @param flightOutticketLog 机票订单出票日志
     * @return 机票订单出票日志
     */
    @Override
    public List<FlightOutticketLog> selectFlightOutticketLogList(FlightOutticketLog flightOutticketLog)
    {
        return flightOutticketLogMapper.selectFlightOutticketLogList(flightOutticketLog);
    }

    /**
     * 新增机票订单出票日志
     * 
     * @param flightOutticketLog 机票订单出票日志
     * @return 结果
     */
    @Override
    public synchronized int insertFlightOutticketLog(FlightOutticketLog flightOutticketLog)
    {
        flightOutticketLog.setCreateTime(DateUtils.getNowDate());
        return flightOutticketLogMapper.insertFlightOutticketLog(flightOutticketLog);
    }

    /**
     * 修改机票订单出票日志
     * 
     * @param flightOutticketLog 机票订单出票日志
     * @return 结果
     */
    @Override
    public int updateFlightOutticketLog(FlightOutticketLog flightOutticketLog)
    {
        return flightOutticketLogMapper.updateFlightOutticketLog(flightOutticketLog);
    }

    /**
     * 批量删除机票订单出票日志
     * 
     * @param logids 需要删除的机票订单出票日志ID
     * @return 结果
     */
    @Override
    public int deleteFlightOutticketLogByIds(Long[] logids)
    {
        return flightOutticketLogMapper.deleteFlightOutticketLogByIds(logids);
    }

    /**
     * 删除机票订单出票日志信息
     * 
     * @param logid 机票订单出票日志ID
     * @return 结果
     */
    @Override
    public int deleteFlightOutticketLogById(Long logid)
    {
        return flightOutticketLogMapper.deleteFlightOutticketLogById(logid);
    }

    //通过订单号查询出票日志
    @Override
    public List<FlightOutticketLog> queryLogByOrderId(Long orderId) {
        return flightOutticketLogMapper.queryLogByOrderId(orderId);
    }
}
